/*
 * @Author: nns4
 * @Date: 2021-01-13 13:47:22
 * @LastEditors: nns4
 * @FilePath: /studyNote/node/fs/writeFileSync.js
 * @Description: 同步写文件
 */
const fs = require('fs')

const content = '一些内容2'

try {
    const data = fs.writeFileSync('./index.js', content)
    //文件写入成功。
} catch (err) {
    console.error(err)
}